package com.hisysteTopet.hisystepet.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hisysteTopet.hisystepet.bean.Pet;
import com.hisysteTopet.hisystepet.bean.ShopCart;
import com.hisysteTopet.hisystepet.mapper.PetMapper;
import com.hisysteTopet.hisystepet.mapper.ShopCartMapper;
import com.hisysteTopet.hisystepet.service.PetService;
import com.hisysteTopet.hisystepet.service.ShopCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ShopCartServiceImpl extends ServiceImpl<ShopCartMapper, ShopCart> implements ShopCartService {

    @Autowired
    private ShopCartMapper shopCartMapper;

    @Override
    public void InsertShopCartMessage(String username, Integer petId, Integer lifeGoodsId,
                                      Date data,String classify,String url,
                                      String pet_name,String life_goods_name,Double money){
        shopCartMapper.InsertShopCartMessage(username,petId,lifeGoodsId,data,classify,
                url,pet_name,life_goods_name,money);
    }

    @Override
    public ShopCart SelectByUsernameAndPetId(String username, Integer PetId) {
        return shopCartMapper.SelectByUsernameAndPetId(username,PetId);
    }

    @Override
    public ShopCart SelectByUsernameAndLifeGoodsId(String username, Integer lifeGoodsId) {
        return shopCartMapper.SelectByUsernameAndLifeGoodsId(username,lifeGoodsId);
    }

    @Override
    public List<ShopCart> SelectAllShopCartByUsername(String username) {
        return shopCartMapper.SelectAllShopCartByUsername(username);
    }

    @Override
    public void DeleteshouCartMessageByIdAndClassifyToPet(Integer petId, String username, String classify) {
        shopCartMapper.DeleteshouCartMessageByIdAndClassifyToPet(petId,username,classify);
    }

    @Override
    public void DeleteshouCartMessageByIdAndClassifyToPetLifeGoods(Integer lifeGoodsId, String username, String classify) {
        shopCartMapper.DeleteshouCartMessageByIdAndClassifyToPetLifeGoods(lifeGoodsId,username,classify);
    }
}
